package com.csc.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

/*@Author HoangHung*/
@Entity
public class Account implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer accountId;
	private String accountType;
	private String accountNumber;

	private Double balance;

	@ManyToOne
	@JoinColumn(name = "idCustomer")
	private Customer idCustomer;

	@ManyToOne
	@JoinColumn(name = "idState")
	private State idState;

	@OneToMany(mappedBy = "sendAccountId")
	private List<Transaction> transactionSendAccount;

	@OneToMany(mappedBy = "receiveAccountId")
	private List<Transaction> transactionReceiveAccount;

	public List<Transaction> getTransactionSendAccount() {
		return transactionSendAccount;
	}

	public void setTransactionSendAccount(
			List<Transaction> transactionSendAccount) {
		this.transactionSendAccount = transactionSendAccount;
	}

	public List<Transaction> getTransactionReceiveAccount() {
		return transactionReceiveAccount;
	}

	public void setTransactionReceiveAccount(
			List<Transaction> transactionReceiveAccount) {
		this.transactionReceiveAccount = transactionReceiveAccount;
	}

	public Customer getIdCustomer() {
		return idCustomer;
	}

	public void setIdCustomer(Customer idCustomer) {
		this.idCustomer = idCustomer;
	}

	public State getIdState() {
		return idState;
	}

	public void setIdState(State idState) {
		this.idState = idState;
	}

	public Account(Integer accountId, String accountType, String accountNumber,
			Double balance) {
		super();
		this.accountId = accountId;
		this.accountType = accountType;
		this.accountNumber = accountNumber;
		this.balance = balance;
	}

	
	public Account(String accountType, String accountNumber, Double balance,
			Customer idCustomer, State idState) {
		super();
		this.accountType = accountType;
		this.accountNumber = accountNumber;
		this.balance = balance;
		this.idCustomer = idCustomer;
		this.idState = idState;
	}

	public Account() {
		super();
	}

	public Integer getAccountId() {
		return accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	public String getAccountType() {
		return accountType;
	}

	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public Double getBalance() {
		return balance;
	}

	public void setBalance(Double balance) {
		this.balance = balance;
	}

}
